Skip to content

feat: filter by snapshot id initial snapshot for member/organizations#4018

Merged
ulemons merged 1 commit intomainfrom
fix/use-snapshot-filter-on-initial-snapshots
Apr 13, 2026
Merged

feat: filter by snapshot id initial snapshot for member/organizations#4018
ulemons merged 1 commit intomainfrom
fix/use-snapshot-filter-on-initial-snapshots

Conversation

@ulemons
Copy link
Copy Markdown
Contributor

@ulemons ulemons commented Apr 13, 2026

Note

Medium Risk
Changes the source dataset selection for initial aggregate backfills by filtering to the max snapshotId, which can materially change computed results if snapshots are incomplete or delayed.

Overview
Initial backfill pipes for member and organization segment aggregates now only aggregate rows from the latest snapshot by adding WHERE snapshotId = (SELECT max(snapshotId) ...) to both cdp_member_segment_aggregates_initial_snapshot.pipe and cdp_organization_segment_aggregates_initial_snapshot.pipe.

This ensures the on-demand COPY_MODE replace outputs are built from a single consistent snapshot rather than mixing historical snapshot data.

Reviewed by Cursor Bugbot for commit 4ef0a6c. Bugbot is set up for automated code reviews on this repo. Configure here.

Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
@ulemons ulemons requested a review from epipav April 13, 2026 13:43
@ulemons ulemons self-assigned this Apr 13, 2026
Copilot AI review requested due to automatic review settings April 13, 2026 13:43
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

2 similar comments
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Tinybird “initial snapshot” copy pipes for CDP member/organization segment aggregates to operate on a single deduplicated snapshot, aligning them with the lambda architecture convention of querying only the latest snapshotId.

Changes:

  • Filter organization segment aggregate initial snapshot to max(snapshotId).
  • Filter member segment aggregate initial snapshot to max(snapshotId).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
services/libs/tinybird/pipes/cdp_organization_segment_aggregates_initial_snapshot.pipe Restricts initial aggregate build to the latest snapshot to avoid cross-snapshot double counting.
services/libs/tinybird/pipes/cdp_member_segment_aggregates_initial_snapshot.pipe Restricts initial aggregate build to the latest snapshot to avoid cross-snapshot double counting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ulemons ulemons merged commit a456787 into main Apr 13, 2026
22 checks passed
@ulemons ulemons deleted the fix/use-snapshot-filter-on-initial-snapshots branch April 13, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants